function plotCDF( mu, sigma, invert )
%PLOTCDF Plot CDF of normal distribution
%   
% mu ..     mean of distribution
% sigma ..  standard deviation of distribution
% invert .. false.. plot CDF; true .. plot 1-CDF (optional, default:false)

if (nargin < 3)
    invert = false;
end
invert = logical(invert);

interval = [mu-3*sigma mu+3*sigma];

X = linspace(interval(1),interval(2),100);

if (invert == 0)
    Y = normcdf (X,mu,sigma);
else
    Y= 1 - normcdf (X,mu,sigma);
end

plot (X,Y,'-');

